<template>
  <div class="page-container">{{ state.pageTitle }}</div>
</template>

<script lang="ts" setup>
import { reactive, watch } from 'vue';
import { useRouter } from 'vue-router';

const state = reactive({
  pageTitle: null
});
const { currentRoute } = useRouter();
state.pageTitle = currentRoute.value.meta.title;
watch(
  () => currentRoute.value,
  (newVal) => {
    state.pageTitle = newVal.meta.title;
  },
  { immediate: true }
);
</script>

<style lang="less" scoped></style>
